package basics.exceptions;
import javax.swing.*;
class PayRaise
{
   public static void main(String[] args) 
   {  
      double oldPay = 0;
      double newPay = 0;
      final double INCREASE = 0.04;
      final double TAXRATE = 0.28;
      final double HRSPERWEEK = 40;
      final double INSURANCE = 140.00;
      String entry;
      entry = JOptionPane.showInputDialog(null,
         "Enter old pay per hour");
      oldPay = Double.parseDouble(entry);
      newPay = oldPay + oldPay * INCREASE;
      newPay = (newPay * HRSPERWEEK) -
        (newPay * TAXRATE) - INSURANCE;
      assert oldPay < newPay:
        "Old Pay is " + oldPay +
        "\nNew pay is $" + newPay +
        "\nNew pay should be more than old pay";
      JOptionPane.showMessageDialog(null,
        "New net pay is $" + newPay + " per week");
   }
}
